<div class="form">
    
<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'dispatchdetails-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>
        
    <div class="left-column">
    	<div class="row short">
			<?php echo $form->labelEx($model,'dispatch'); ?>
	            <div class="model-data">
	                <?php echo $model->dispatch; ?>
	            </div>
			
	                <?php echo $form->hiddenField($model,'dispatch');?>
			<?php echo $form->error($model,'dispatch'); ?>
		</div>
	        
	        <?php echo $form->hiddenField($model,'custno');?>
	        <?php echo $form->hiddenField($model,'locno');?>
	        
	    <div class="row short">
			<?php echo $form->labelEx($model,'calledinby'); ?>
			<?php echo $form->textField($model,'calledinby',array('size'=>25,'maxlength'=>25)); ?>
			<?php echo $form->error($model,'calledinby'); ?>
		</div>
	        
	    <div class="row short">
			<?php echo $form->labelEx($model,'department'); ?>
			<?php echo $form->dropDownList($model,'department',$model->getDepartmentList()); ?>
			<?php echo $form->error($model,'department'); ?>
		</div>
	       

		<div class="row short">
			<?php echo $form->labelEx($model,'priority'); ?>
			<?php echo $form->dropDownList($model,'priority',$model->getPriorityList()); ?>
			<?php echo $form->error($model,'priority'); ?>
		</div>

		
	    <div class="row short">
			<?php echo $form->labelEx($model,'receivedby'); ?>
	            <div class="model-data">
	                <?php echo $model->receivedby;?>
	            </div>
			
			<?php echo $form->error($model,'receivedby'); ?>
		</div>
	        
		<div class="row short">
			<?php echo $form->labelEx($model,'receiveddate'); ?>
			<?php $this->widget('zii.widgets.jui.CJuiDatePicker',array(
	                    'model'=>$model,
	                    'attribute'=>'receiveddate',
	                    'value'=>CTimestamp::formatDate('m-d-Y',$model->receiveddate),
	                    'options' => array('receiveddate'=>'m-d-yy'),
	                )); ?>
			<?php echo $form->error($model,'dateofnote'); ?>
		</div>

		<div class="row short">
			<?php echo $form->labelEx($model,'receivedtime'); ?>
			<?php $this->widget('CMaskedTextField',array(
	                    'model'=>$model,
	                    'attribute'=>'receivedtime',
	                    'mask'=>'99:99:99',
	                    'htmlOptions'=>array(
	                        'size'=>6
	                    )
	                ));?>
			<?php echo $form->error($model,'receivedtime'); ?>
		</div>
			
	    <div class="row short">
			<?php echo $form->labelEx($model,'ponumber'); ?>
			<?php echo $form->textField($model,'ponumber',array('size'=>20,'maxlength'=>20)); ?>
			<?php echo $form->error($model,'ponumber'); ?>
		</div>

	    <div class="row short">
            <?php echo $form->labelEx($model,'wonumber'); ?>
            <?php echo $form->textField($model,'wonumber',array('size'=>20,'maxlength'=>20)); ?>
            <?php echo $form->error($model,'wonumber'); ?>
	    </div>        
		
		<div class="row short">
			<?php echo $form->labelEx($model,'jobnumber'); ?>
			<?php echo $form->dropDownList($model,'jobnumber',array()); ?>
			<?php echo $form->error($model,'jobnumber'); ?>
		</div>

	    <div class="row short">
			<?php echo $form->labelEx($model,'invoice'); ?>
			<?php echo $form->textField($model,'invoice',array('size'=>10,'maxlength'=>10)); ?>
			<?php echo $form->error($model,'invoice'); ?>
		</div>
			        	
		
    </div>   


<?php $this->endWidget(); ?>

</div><!-- form -->
<script type="text/javascript">
 $("form").submit(function() {            
            var billingType = $("#Dispatchdetails_billingtype").css("display","none");
            var billableTime = $("#Dispatchdetails_techtime").css("display","none");
            var billParts = $("#Dispatchdetails_billparts").css("display","none");
            var billNotes = $("#Dispatchdetails_billnotes").css("display","none");
            
            $('#dispatchdetails-form').append($(billingType));
            $('#dispatchdetails-form').append($(billableTime));
            $('#dispatchdetails-form').append($(billParts));
            $('#dispatchdetails-form').append($(billNotes));
            return true;
        });
</script>
